Skip to content

fix(integrations): resolve Server Components crash on the integration detail page (digest 783665031)#5345

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/integrations-rsc-fallback-crash
Jul 2, 2026
Merged

fix(integrations): resolve Server Components crash on the integration detail page (digest 783665031)#5345
waleedlatif1 merged 1 commit into
stagingfrom
fix/integrations-rsc-fallback-crash

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause (confirmed via staging server logs — digest 783665031): the integration detail route [block]/page.tsx is a server component, and its Suspense fallback rendered <ChipLink leftIcon={ArrowLeft}>. That passes the lucide ArrowLeft (a function) across the server→client boundary, which React Server Components rejects: "Functions cannot be passed directly to Client Components." It surfaced as the integrations error boundary ("Failed to load integrations") on soft navigation to a detail page — while a hard refresh papered over it, matching the reported "fails on nav, works on refresh" behavior.
  • Fix: move the fallback into a small 'use client' component (IntegrationBlockDetailFallback) that receives only workspaceId (a string). The icon now lives entirely client-side and never crosses the boundary.
  • Audited every server route entry (page/layout/template/default) — this was the only occurrence of the anti-pattern.

Type of Change

  • Bug fix

Testing

Root cause identified directly from the staging CloudWatch app logs (the digest: '783665031' line = "Functions cannot be passed directly to Client Components"). Fix compiles clean (biome + tsc); the server component no longer imports ChipLink/ArrowLeft, so no function prop crosses the RSC boundary.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

… detail page

Root cause (confirmed via staging server logs, digest 783665031): the [block] page.tsx is a server component whose Suspense fallback rendered <ChipLink leftIcon={ArrowLeft}> — passing the lucide icon (a function) across the server->client boundary, which React rejects ("Functions cannot be passed directly to Client Components"). This surfaced as the integrations error boundary / "Failed to load integrations" on soft navigation to a detail page. Move the fallback into a client component so the icon never crosses the boundary.
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 2, 2026 12:32am

Request Review

@cursor

cursor Bot commented Jul 2, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Small UI loading-state refactor with no auth, data, or API changes; behavior is limited to the integration detail route.

Overview
Fixes integration detail soft navigation hitting the integrations error boundary because the server page.tsx Suspense fallback passed lucide ArrowLeft into ChipLink as leftIcon, crossing the server→client boundary with a function.

The fallback UI is unchanged visually but now lives in IntegrationBlockDetailFallback ('use client'), which only receives workspaceId. The server page drops ChipLink/ArrowLeft imports and wires Suspense to that component instead of an inline fallback.

Reviewed by Cursor Bugbot for commit 97aac58. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a React Server Components crash on the integration detail page caused by passing a lucide ArrowLeft function component as a prop in the Suspense fallback of a server component, which React rejects across the server→client boundary.

  • Root cause fix: The inline Suspense fallback JSX in page.tsx (a server component) passed ArrowLeft as leftIcon to ChipLink. React cannot serialize function references across the RSC boundary, triggering the digest: 783665031 error. Moving the fallback into a dedicated 'use client' file keeps the icon entirely client-side.
  • Scope: Only workspaceId (a string) is passed from the server page to the new IntegrationBlockDetailFallback client component — correct and serialization-safe.

Confidence Score: 5/5

Safe to merge — the change is a minimal, targeted extraction that directly resolves a confirmed production crash without altering any logic or data flow.

The fix correctly isolates the ArrowLeft function reference inside a 'use client' component so it never crosses the RSC boundary. The only value passed from the server page to the new client component is workspaceId (a plain string), which serializes without issue. The rendered fallback UI is pixel-identical to what was there before. No other files are touched and the change is self-contained.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/integrations/[block]/integration-block-detail-fallback.tsx New 'use client' component that contains the ChipLink + ArrowLeft fallback UI; correctly scopes the function prop to the client boundary.
apps/sim/app/workspace/[workspaceId]/integrations/[block]/page.tsx Server component now delegates its Suspense fallback to the new client component; no more function prop crossing the RSC boundary.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Browser
    participant Server as Server Component (page.tsx)
    participant Client as Client Component (IntegrationBlockDetailFallback)

    Browser->>Server: Navigate to /integrations/[block]
    Server->>Server: await params, lookup integration
    Server-->>Browser: Stream RSC payload with Suspense boundary
    Note over Browser,Client: Suspense fallback renders while IntegrationBlockDetail loads
    Server->>Client: Pass workspaceId (string) — serializable ✓
    Client-->>Browser: Render ChipLink + ArrowLeft (function stays client-side)
    Note over Browser,Client: IntegrationBlockDetail resolves, replaces fallback
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Browser
    participant Server as Server Component (page.tsx)
    participant Client as Client Component (IntegrationBlockDetailFallback)

    Browser->>Server: Navigate to /integrations/[block]
    Server->>Server: await params, lookup integration
    Server-->>Browser: Stream RSC payload with Suspense boundary
    Note over Browser,Client: Suspense fallback renders while IntegrationBlockDetail loads
    Server->>Client: Pass workspaceId (string) — serializable ✓
    Client-->>Browser: Render ChipLink + ArrowLeft (function stays client-side)
    Note over Browser,Client: IntegrationBlockDetail resolves, replaces fallback
Loading

Reviews (1): Last reviewed commit: "fix(integrations): resolve Server Compon..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit 4df352f into staging Jul 2, 2026
17 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/integrations-rsc-fallback-crash branch July 2, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant